package util;

import org.yaml.snakeyaml.Yaml;
import org.yaml.snakeyaml.constructor.Constructor;
import property.RouteProperty;

import java.io.InputStream;

public class YamlUtil<T> {
    public T getYml(Class<RouteProperty> claz, String ymlurl)
    {
        Yaml yaml = new Yaml(new Constructor(claz));
        InputStream inputStream = YamlUtil.class
                .getClassLoader()
                .getResourceAsStream(ymlurl);
        return yaml.load(inputStream);
    }
}
